import 'package:flutter/material.dart';
import 'package:gesture_exp/scale_pan/gesture_zoom_box.dart';

main(List<String> args) {
  runApp(MaterialApp(
    home: GestureBoxTestPage(),
  ));
}

class GestureBoxTestPage extends StatefulWidget {
  GestureBoxTestPage({Key key}) : super(key: key);

  @override
  _GestureBoxTestPageState createState() => _GestureBoxTestPageState();
}

class _GestureBoxTestPageState extends State<GestureBoxTestPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        margin: EdgeInsets.all(20),
        // constraints: BoxConstraints.expand(),
        decoration: BoxDecoration(
          border: Border.all(color: Colors.blue, width: 1.0),
        ),
        child: _buildContent(),
      ),
    );
  }

  Widget _buildContent() {
    final contentKey = GlobalKey();
    Widget widget = Container(
      key: contentKey,
      decoration: BoxDecoration(
        border: Border.all(color: Colors.red, width: 1),
      ),
      // width: 200,
      // height: 200,
      child: Image.asset(
        'images/f.jpg',
      ),
    );

    widget = GestureZoomBox(
      child: widget,
    );

    return widget;
  }
}
